   #include<stdio.h>
   #include<math.h>
   main()
   {
   float i,x,n,s,pi,t,sign;
   t=1;
   x=0;
   s=0;
   sign=1;
   while(fabs(s>=1e-6))
   { 
   x=sign/t;
   s+=x;
    t+=2;
   sign=-sign;	
   }
   pi=s*4;
   printf("pi=%f\n",pi);
   }